package com.example.petshopping.model;

import com.google.gson.annotations.SerializedName;

/**
 * 通用响应模型
 */
public class CommonResult<T> {
    
    @SerializedName("code")
    private Integer code;
    
    @SerializedName("data")
    private T data;
    
    @SerializedName("msg")
    private String msg;

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    
    public boolean isSuccess() {
        return code != null && code == 0;
    }
} 